Ext.define('wmf.controller.groupRole.groupRole', {
    extend: 'Ext.app.Controller',
    stores: ['groupRole.tree',
             "groupRole.groupRole"
            ],
    models: [],
    views: ['groupRole.main', 
            'groupRole.tree',
            'groupRole.grid'
            ],
    refs: [{
        ref: 'groupRoleTree',
        selector: 'groupRoleTree'
    },{
    	ref: 'groupRoleGrid',
    	selector: 'groupRoleGrid'
    }],
    
    init: function () {
        this.control({
			'groupRoleTree' : {
				itemclick: this.menuClick
			}
        });
        wmf.groupRole = {};
        wmf.groupRole.params = {};
    },

    menuClick: function(tree, node, item, index, e, eOpts){
    	var me = this;
    	var grid = me.getGroupRoleGrid();
    	wmf.groupRole.params.clickGroupId = node.data.groupRoleId;
		grid.getStore().reload();
    }
});
